<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>添加/编辑商品分类 - Powered By ${systemConfig.systemName}</title>
<meta name="Author" content="webmall Team" />
<meta name="Copyright" content="webmall" />
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<#include "/WEB-INF/template/common/include.ftl">
<link href="${base}/template/admin/css/input.css" rel="stylesheet" type="text/css" />

<#if !id??>
	<#assign isAdd = true />
<#else>
	<#assign isEdit = true />
</#if>
<script>
<!--
$(function(){
  $("#s1 option:first,#s2 option:first").attr("selected",true);
  $("#s1").dblclick(function(){
    var alloptions = $("#s1 option");
    var so = $("#s1 option:selected");
 if(so === null || so == "undefined"){
  return;
 }
 try{
     var a = (so.get(so.length-1).index == alloptions.length-1)? so.prev().attr("selected",true):so.next().attr("selected",true);
    }catch(e){
     return;
    }
    $("#s2").append(so);
  });
 
  $("#s2").dblclick(function(){
    var alloptions = $("#s2 option");
    var so = $("#s2 option:selected");
 if(so === null || so == "undefined"){
  return;
 }
    try{
     var a = (so.get(so.length-1).index == alloptions.length-1)? so.prev().attr("selected",true):so.next().attr("selected",true);
    }catch(e){
     return;
    }
    $("#s1").append(so);
  });
 
  $("#add").click(function(){
    var alloptions = $("#s1 option");
    var so = $("#s1 option:selected");
    var a = (so.get(so.length-1).index == alloptions.length-1)? so.prev().attr("selected",true):so.next().attr("selected",true);
   
    $("#s2").append(so);
  });
 
  $("#remove").click(function(){
    var alloptions = $("#s2 option");
    var so = $("#s2 option:selected");
   
    var a = (so.get(so.length-1).index == alloptions.length-1)? so.prev().attr("selected",true):so.next().attr("selected",true);
   
    $("#s1").append(so);
  });
 
  $("#addall").click(function(){
    $("#s2").append($("#s1 option").attr("selected",true));
  });
 
  $("#removeall").click(function(){
    $("#s1").append($("#s2 option").attr("selected",true));
  });
 
  $("#s1up").click(function(){
    var so = $("#s1 option:selected");
    if(so.get(0).index!==0){
      so.each(function(){
          $(this).prev().before($(this));
      });
    }
  });
 
  $("#s1down").click(function(){
    var alloptions = $("#s1 option");
    var so = $("#s1 option:selected");
   
    if(so.get(so.length-1).index!=alloptions.length-1){
      for(i=so.length-1;i>=0;i=1-1)
      {
        var item = $(so.get(i));
        item.insertAfter(item.next());
      }
    }
  });
 
  $("#s2up").click(function(){
    var so = $("#s2 option:selected");
    if(so.get(0).index!==0){
      so.each(function(){
          $(this).prev().before($(this));
      });
    }
  });
 
  $("#s2down").click(function(){
    var alloptions = $("#s2 option");
    var so = $("#s2 option:selected");
   
    if(so.get(so.length-1).index!=alloptions.length-1){
      for(i=so.length-1;i>=0;i--)
      {
        var item = $(so.get(i));
        item.insertAfter(item.next());
      }
    }
  });
});
-->
</script>
</head>
<body class="input">
	<div class="body">
		<div class="inputBar">
			<h1><span class="icon">&nbsp;</span><#if isAdd??>添加商品分类<#else>编辑商品分类</#if></h1>
		</div>
		<form id="inputForm" class="validate" action="product_category!propertiesSave.action" method="post">
			<input type="hidden" name="id" value="${id}" />
			<table class="inputTable">
				<tr>
					<th>
						分类名称:<font color='red'>[${(productCategory.name)!}]</font>
					</th>
					<th colspan="3">
					</th>
				</tr>
				<tr>
					<th>
						尺寸/大小/容积:
					</th>
					<td colspan="3">
						<select name="productSize.id">
							<option value="">---------------</option>
							<#list allProperties as list>
								<option value="${list.id}" <#if list.id==productCategory.productSize.id >selected</#if>>
									${list.enumLable}
								</option>
							</#list>
						</select>
					</td>
				</tr>
				<tr>
					<th>
						销售属性:
					</th>
					<td width=140>
						<select id="s1" multiple="multiple" name="beforepropertieIds" style="height:200px;width:120px;">
							<#list allProperties as list>
                                <#if productCategory.propertiesSet?contains(list)>
                                    ;
                                <#else>
								<option value="${list.id}">
									${list.enumLable}
								</option>
                                </#if> 
							</#list>
						</select>
                        </td>
                      <td width=60>
                          <input type="button" name="add" id="add" value="&gt;&gt;" /><br />
                          <input type="button" name="remove" id="remove" value="&lt;&lt;" /><br />
                      </td>
                        <td><select id="s2" multiple="multiple" name="propertieIds" style="height:200px;width:120px;">
							<#list productCategory.propertiesSet as list>
								<option value="${list.id}">
									${list.enumLable}
								</option>
							</#list>
						</select>
                        
					</td>
				</tr>
			</table>
			<div class="buttonArea">
				<input type="submit" class="formButton" value="确  定" hidefocus="true" />&nbsp;&nbsp;&nbsp;&nbsp;
				<input type="button" class="formButton" onclick="window.history.back(); return false;" value="返  回" hidefocus="true" />
			</div>
		</form>
	</div>
</body>
</html>